
<%@page import="com.yourcompany.struts.form.ProductMasterForm"%>
<%@page import="com.dts.project.dao.ProductMasterDao"%> 
 
 
 
 <%
 String target="ProductMaster.jsp?status=Registration failed";
 try
 {
 ProductMasterForm form=new ProductMasterForm();
 form.setProductName(request.getParameter("productName"));
 form.setProductDesc(request.getParameter("productDesc"));
 ProductMasterDao dao=new ProductMasterDao();
 boolean flag=dao.insertProductMaster(form);
 if(flag)
 {
 target="ProductMaster.jsp?status=Registration success";
 }
 }
 catch(Exception e)
 {
 e.printStackTrace();
 }
 RequestDispatcher rd=request.getRequestDispatcher(target);
 rd.forward(request,response);
%>

 